//
//  SearchViewController.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/2/19.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class SearchViewController: UISearchController {
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }
    
    override init(searchResultsController: UIViewController?) {
        super.init(searchResultsController: searchResultsController)
        setupSearchBar()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .white
    }
}

// MARK: - Setting
extension SearchViewController {
    private func setupSearchBar() {
        searchBar.barTintColor = .white
        searchBar.placeholder = "按症状、疾病、科室、医生姓名找医生"
        searchBar.tintColor = .textDark
        searchBar.setBackgroundImage(UIImage(color: .white), for: .any, barMetrics: .default)
    }
}
